<?php

namespace App\Http\Controllers\Api\getParams;

use Illuminate\Http\Request;
use App\Jobs\OrderSubmit;
use Monolog\Logger;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\RotatingFileHandler;
use Carbon\Carbon;
use App\Repository\UpThree\MainOrderRepostition;
use App\Http\Controllers\Api\BaseController;

class PddController extends BaseController
{
  private $log;
  public function __construct()
  {
    $this->log = new Logger('PddGetCode');
    $this->log->pushHandler(
      (new RotatingFileHandler(storage_path('/logs/PddGetCode.log'), 14, Logger::DEBUG, true, 0777))->setFormatter(new LineFormatter(null, null, true, true))
    );
  }
  // 获取拼多多的code 
  public function getPddCode(Request $request)
  {
    $code = $request->has('code') && $request->get('code') != '' ? $request->get('code') : '';
    $time = time();
    $this->log->info('拼多多pdd获取详细参数' . json_encode($request));
    if ($code != '') {
      return $code; // 直接返回code
    };
    return '未查询到';
  }
}
